package com.shelpe.services.scheduler.item.recommendword;

import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.shelpe.services.scheduler.dto.AdgroupRecordDto;
import com.shelpe.services.scheduler.po.Adgroups;
import com.shelpe.services.scheduler.syncclient.RecommendWordClient;

@Component("recommendWordProcessor")
public class RecommendWordProcessorImpl implements ItemProcessor<Adgroups, Adgroups>{

	@Autowired
	private RecommendWordClient reClient;
	
	@Override
	public Adgroups process(Adgroups item) throws Exception {
		// TODO Auto-generated method stub		
		long adgroupId = item.getAdgroupId();
		String nick = item.getNick();
		AdgroupRecordDto dto = new AdgroupRecordDto();
		dto.setNeedSync(true);
		dto.setNick(nick);
		reClient.create(adgroupId, dto);
		
		return null;
	}
	
	
}
